home *** CD-ROM | disk | FTP | other *** search
/ Aminet 24 / Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso / Aminet / dev / misc / Hunk.lha / Hunk / Hoppers / PCQ_12b.hop < prev    next >
Text File  |  1998-02-14  |  6KB  |  147 lines

  1. ;*************************************************************************
  2. ;** PCQ 1.2b                                                            **
  3. ;** Contributor: L.Lucius                               Sept 23rd 1995  **
  4. ;** Modified for HOp:   Thomas Richter  (thor)          Nov  1st  1997  **
  5. ;** Function:    Modify 68000 math routines to use 68020+ instructions. **
  6. ;*************************************************************************
  7.  
  8.  
  9.  
  10. ;*************************************************************************
  11. ;
  12. ; DIVS
  13. #match
  14. #code
  15. 202F 0004                       ;   MOVE.L      0004(A7),D0
  16. 6A02                            ;   BPL.B       0008
  17. 4480                            ;   NEG.L       D0
  18. 222F 0008                       ;   MOVE.L      0008(A7),D1
  19. 6A08                            ;   BPL.B       0016
  20. 4481                            ;   NEG.L       D1
  21. 0A2F 0080 0004                  ;   EORI.B      #80,0004(A7)
  22. 6100 008E                       ;   BSR.W       00A6
  23. 4A2F 0004                       ;   TST.B       0004(A7)
  24. 6A02                            ;   BPL.B       0022
  25. 4480                            ;   NEG.L       D0
  26. 4E75                            ;   RTS
  27. ;
  28. ; MULS()
  29. ;
  30. 202F 0004                       ;   MOVE.L      0004(A7),D0
  31. 6A02                            ;   BPL.B       002C
  32. 4480                            ;   NEG.L       D0
  33. 222F 0008                       ;   MOVE.L      0008(A7),D1
  34. 6A08                            ;   BPL.B       003A
  35. 4481                            ;   NEG.L       D1
  36. 0A2F 0080 0004                  ;   EORI.B      #80,0004(A7)
  37. 614E                            ;   BSR.B       008A
  38. 4A2F 0004                       ;   TST.B       0004(A7)
  39. 6A02                            ;   BPL.B       0044
  40. 4480                            ;   NEG.L       D0
  41. 4E75                            ;   RTS
  42. ;
  43. ; MODS()
  44. ;
  45. 202F 0004                       ;   MOVE.L      0004(A7),D0
  46. 6A02                            ;   BPL.B       004E
  47. 4480                            ;   NEG.L       D0
  48. 222F 0008                       ;   MOVE.L      0008(A7),D1
  49. 6A02                            ;   BPL.B       0056
  50. 4481                            ;   NEG.L       D1
  51. 614E                            ;   BSR.B       00A6
  52. 2001                            ;   MOVE.L      D1,D0
  53. 4A2F 0004                       ;   TST.B       0004(A7)
  54. 6A02                            ;   BPL.B       0062
  55. 4480                            ;   NEG.L       D0
  56. 4E75                            ;   RTS
  57. ;
  58. ; DIVU
  59. ;
  60. 202F 0004                       ;   MOVE.L      0004(A7),D0
  61. 222F 0008                       ;   MOVE.L      0008(A7),D1
  62. 6138                            ;   BSR.B       00A6
  63. 4E75                            ;   RTS
  64. ;
  65. ; MULU
  66. ;
  67. 202F 0004                       ;   MOVE.L      0004(A7),D0
  68. 222F 0008                       ;   MOVE.L      0008(A7),D1
  69. 6110                            ;   BSR.B       008A
  70. 4E75                            ;   RTS
  71. ;
  72. ; MODU
  73. ;
  74. 202F 0004                       ;   MOVE.L      0004(A7),D0
  75. 222F 0008                       ;   MOVE.L      0008(A7),D1
  76. 6120                            ;   BSR.B       00A6
  77. 2001                            ;   MOVE.L      D1,D0
  78. 4E75                            ;   RTS
  79. ;
  80. ;
  81. #replace
  82. ;
  83. ; DIVS()
  84. ;
  85. 222F 0004                       ;   MOVE.L      0004(A7),D0
  86. 4C6F 0800 0008                  ;   DIVS.L      0008(A7),D0
  87. 4E75                            ;   RTS
  88. 6A08                            ;   BPL.B       0016
  89. 4481                            ;   NEG.L       D1
  90. 0A2F 0080 0004                  ;   EORI.B      #80,0004(A7)
  91. 6100 008E                       ;   BSR.W       00A6
  92. 4A2F 0004                       ;   TST.B       0004(A7)
  93. 6A02                            ;   BPL.B       0022
  94. 4480                            ;   NEG.L       D0
  95. 4E75                            ;   RTS
  96. ;
  97. ; MULS
  98. ;
  99. 202F 0004                       ;   MOVE.L      0004(A7),D0
  100. 4C2F 0800 0008                  ;   MULS.L      0008(A7),D0
  101. 4E75                            ;   RTS
  102. 6A08                            ;   BPL.B       003A
  103. 4481                            ;   NEG.L       D1
  104. 0A2F 0080 0004                  ;   EORI.B      #80,0004(A7)
  105. 614E                            ;   BSR.B       008A
  106. 4A2F 0004                       ;   TST.B       0004(A7)
  107. 6A02                            ;   BPL.B       0044
  108. 4480                            ;   NEG.L       D0
  109. 4E75                            ;   RTS
  110. ;
  111. ; MODS
  112. ;
  113. 202F 0004                       ;   MOVE.L      0004(A7),D0
  114. 4C6F 0801 0008                  ;   DIVSL.L     0008(A7),D1:D0
  115. C141                            ;   EXG         D0,D1
  116. 4E75                            ;   RTS
  117. 4481                            ;   NEG.L       D1
  118. 614E                            ;   BSR.B       00A6
  119. 2001                            ;   MOVE.L      D1,D0
  120. 4A2F 0004                       ;   TST.B       0004(A7)
  121. 6A02                            ;   BPL.B       0062
  122. 4480                            ;   NEG.L       D0
  123. 4E75                            ;   RTS
  124. ;
  125. ; DIVU
  126. ;
  127. 202F 0004                       ;   MOVE.L      0004(A7),D0
  128. 4C6F 0000 0008                  ;   DIVU.L      0008(A7),D0
  129. 4E75                            ;   RTS
  130. ;
  131. ; MULU
  132. ;
  133. 202F 0004                       ;   MOVE.L      0004(A7),D0
  134. 4C2F 0000 0008                  ;   MULU.L      0008(A7),D0
  135. 4E75                            ;   RTS
  136. ;
  137. ; MODU
  138. ;
  139. 202F 0004                       ;   MOVE.L      0004(A7),D0
  140. 4C6F 0001 0008                  ;   DIVUL.L     0008(A7),D1:D0
  141. C141                            ;   EXG         D0,D1
  142. 4E75                            ;   RTS
  143. 4C01 0000                       ;   MULU.L      D1,D0
  144. 4E75                            ;   RTS
  145. #end
  146.  
  147.